<template>
  <div class="paper-container">
    <div class="paper-header">
      <h1>论文首页</h1>
      <p class="subtitle">学术研究成果展示</p>
    </div>

    <!-- 个人信息卡片 -->
    <el-card class="info-card">
      <div slot="header" class="card-header">
        <span>个人信息</span>
      </div>
      <div class="info-content-with-avatar">
        <!-- 头像部分 -->
        <div class="avatar-section">
          <div class="avatar-container">
            <img :src="avatarUrl" alt="头像" class="avatar-img" v-if="avatarUrl">
            <div class="avatar-placeholder" v-else>
              <i class="el-icon-user"></i>
            </div>
            <div class="avatar-upload-overlay">
              <el-upload
                class="avatar-uploader"
                action="#"
                :auto-upload="false"
                :on-change="handleAvatarChange"
                :show-file-list="false"
                accept="image/*"
              >
                <el-button size="small" type="primary" icon="el-icon-upload">上传头像</el-button>
              </el-upload>
            </div>
          </div>
        </div>

        <!-- 基本信息 -->
        <div class="info-details">
          <div class="info-item">
            <label>姓名：</label>
            <span>王云龙</span>
          </div>
          <div class="info-item">
            <label>学院：</label>
            <span>工程技术学院</span>
          </div>
          <div class="info-item">
            <label>专业：</label>
            <span>数据科学与大数据技术</span>
          </div>
          <div class="info-item">
            <label>年级：</label>
            <span>2022级</span>
          </div>
          <div class="info-item">
            <label>学号：</label>
            <span>116420220087</span>
          </div>
          <div class="info-item">
            <label>指导教师：</label>
            <span>王教授</span>
          </div>
          <div class="info-item">
            <label>联系方式：</label>
            <span>wangyunlong@example.com</span>
          </div>
        </div>
      </div>
    </el-card>

    <!-- 毕业论文基本信息 -->
    <el-card class="paper-info-card">
      <div slot="header" class="card-header">
        <span>毕业论文基本信息</span>
      </div>
      <div class="paper-info-content">
        <div class="info-section">
          <h3>论文题目</h3>
          <p>诗歌词频分析与风格可视化平台</p>
        </div>
        <div class="info-section">
          <h3>研究方向</h3>
          <p>大数据分析、诗歌词频分析</p>
        </div>
        <div class="info-section">
          <h3>论文摘要</h3>
          <p>本课题围绕古典诗歌的数字化分析，设计并实现了“诗歌词频分析与风格可视化平台”。研究核心在于通过定量计算方法，对诗歌文本进行词频统计与风格特征提取。</p>
        </div>
        <div class="info-section">
          <h3>完成时间</h3>
          <p>2025年5月</p>
        </div>
        <div class="info-section">
          <h3>论文评定</h3>
          <p>优秀</p>
        </div>
      </div>
    </el-card>

    <!-- 论文研究成果 -->
    <el-card class="achievements-card">
      <div slot="header" class="card-header">
        <span>论文研究成果</span>
      </div>
      <div class="achievements-content">
        <!-- 学术论文 -->
        <div class="achievement-section">
          <h3>学术论文</h3>
          <el-timeline>
            <el-timeline-item timestamp="2024年11月" placement="top">
              <el-card>
                <h4>大数据环境下的个性化学习推荐算法研究</h4>
                <p>发表于《计算机科学》期刊，第一作者</p>
              </el-card>
            </el-timeline-item>
            <el-timeline-item timestamp="2025年2月" placement="top">
              <el-card>
                <h4>智能教育系统中的数据隐私保护机制研究</h4>
                <p>发表于《软件学报》期刊，第二作者</p>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </div>

        <!-- 项目经历 -->
        <div class="achievement-section">
          <h3>项目经历</h3>
          <el-timeline>
            <el-timeline-item timestamp="2024年8月-2025年5月" placement="top">
              <el-card>
                <h4>智能教育大数据平台开发</h4>
                <p>负责系统架构设计和核心算法实现</p>
              </el-card>
            </el-timeline-item>
            <el-timeline-item timestamp="2024年3月-2024年7月" placement="top">
              <el-card>
                <h4>在线学习行为分析系统开发</h4>
                <p>参与开发学生学习行为分析模块，提升教学效果评估的准确性</p>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </div>

        <!-- 专利和软件著作权 -->
        <div class="achievement-section">
          <h3>专利和软件著作权</h3>
          <el-timeline>
            <el-timeline-item timestamp="2025年3月" placement="top">
              <el-card>
                <h4>一种基于大数据的学习推荐方法</h4>
                <p>发明专利，申请号：202510012346.7</p>
              </el-card>
            </el-timeline-item>
            <el-timeline-item timestamp="2025年1月" placement="top">
              <el-card>
                <h4>智能教育大数据分析系统</h4>
                <p>软件著作权，登记号：2025SR0123457</p>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </div>

        <!-- 获奖情况 -->
        <div class="achievement-section">
          <h3>获奖情况</h3>
          <el-timeline>
            <el-timeline-item timestamp="2025年5月" placement="top">
              <el-card>
                <h4>校级优秀毕业设计</h4>
                <p>工程技术学院</p>
              </el-card>
            </el-timeline-item>
            <el-timeline-item timestamp="2024年10月" placement="top">
              <el-card>
                <h4>全国大学生大数据技能竞赛</h4>
                <p>教育部高等学校计算机类专业教学指导委员会</p>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'WangyunlongPaperHome',
  data() {
    return {
      avatarUrl: ''
    }
  },
  methods: {
    handleAvatarChange(file) {
      const reader = new FileReader();
      reader.onload = (e) => {
        this.avatarUrl = e.target.result;
        this.$message.success('头像上传成功');
      };
      reader.readAsDataURL(file.raw);
    }
  }
}
</script>

<style scoped>
.paper-container {
  padding: 20px;
  background-color: #f0f2f5;
  min-height: 100vh;
  font-family: 'Microsoft YaHei', sans-serif;
}

.paper-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  color: white;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.paper-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 18px;
  opacity: 0.9;
}

.card-header {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  padding: 15px 20px;
  border-bottom: 2px solid #409eff;
  margin: -20px -20px 20px -20px;
  background-color: #fafafa;
}

.info-card,
.paper-info-card,
.achievements-card {
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover,
.paper-info-card:hover,
.achievements-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* 头像和信息布局 */
.info-content-with-avatar {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 20px;
}

.avatar-section {
  flex: 0 0 200px;
  display: flex;
  justify-content: center;
}

.avatar-container {
  position: relative;
  width: 160px;
  height: 160px;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #409eff;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #409eff;
  background-color: #ecf5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #409eff;
}

.avatar-upload-overlay {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  width: 100%;
  text-align: center;
  padding: 10px 0;
  border-radius: 0 0 70px 70px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.avatar-container:hover .avatar-upload-overlay {
  opacity: 1;
}

.info-details {
  flex: 1;
  min-width: 300px;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 600;
  color: #606266;
  width: 120px;
  font-size: 15px;
}

.info-item span {
  color: #303133;
  font-size: 15px;
  font-weight: 500;
}

.paper-info-content {
  padding: 20px;
}

.paper-info-content .info-section {
  margin-bottom: 25px;
  padding: 20px;
  background-color: #fafafa;
  border-radius: 8px;
  border-left: 4px solid #409eff;
}

.paper-info-content .info-section:last-child {
  margin-bottom: 0;
}

.paper-info-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 12px;
  display: inline-block;
  padding-bottom: 5px;
  border-bottom: 2px solid #409eff;
}

.paper-info-content p {
  color: #606266;
  line-height: 1.8;
  text-align: justify;
  font-size: 15px;
}

.achievements-content {
  padding: 20px;
}

.achievements-content .achievement-section {
  margin-bottom: 40px;
  position: relative;
}

.achievements-content .achievement-section:last-child {
  margin-bottom: 0;
}

.achievements-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #409eff;
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.el-timeline-item__timestamp {
  font-size: 14px;
  color: #409eff;
  font-weight: 500;
}

.el-timeline-item__content {
  padding-top: 0;
  padding-left: 20px;
}

.el-timeline-item__node {
  background-color: #409eff;
  box-shadow: 0 0 0 4px rgba(64, 158, 255, 0.2);
}

.achievement-section .el-card {
  margin-bottom: 15px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid #409eff;
}

.achievement-section .el-card:hover {
  transform: translateX(10px);
  box-shadow: 0 4px 20px rgba(64, 158, 255, 0.2);
}

.achievement-section .el-card h4 {
  font-size: 17px;
  color: #303133;
  margin-bottom: 8px;
  font-weight: 600;
}

.achievement-section .el-card p {
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .info-content-with-avatar {
    flex-direction: column;
    align-items: center;
  }

  .avatar-section {
    flex: none;
  }

  .info-details {
    width: 100%;
  }

  .paper-header h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 16px;
  }
}
</style>
